#include <iostream>
using namespace std;

// 创建Draw 类
class Draw {
private:
    int height; // 高度

public:
    // 构造函数
    Draw(int height) : height(height) {}

    // 绘制三角形
    void drawTriangle() const {
        for (int i = 1; i <= height; ++i) {
            for (int j = 0; j < height - i; ++j) cout << " ";
            for (int j = 0; j < 2 * i - 1; ++j) cout << "*";
            cout << endl;
        }
        cout << endl;
    }

    // 绘制正方形
    void drawSquare() const {
        for (int i = 0; i < height; ++i) {
            for (int j = 0; j < height; ++j) cout << "* ";
            cout << endl;
        }
        cout << endl;
    }

    // 绘制平行四边形
    void drawParallelogram() const {
        for (int i = 0; i < height; ++i) {
            for (int j = 0; j < height - i - 1; ++j) cout << " ";
            for (int j = 0; j < height; ++j) cout << "* ";
            cout << endl;
        }
        cout << endl;
    }
};

int main() {
    // 创建对象并绘制三种形状
    Draw shape(4);

    shape.drawTriangle();
    shape.drawSquare();
    shape.drawParallelogram();

    return 0;
}


